/*
 * @(#)AddressContext.java
 * Date 2013-11-17
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.ws;

import java.io.IOException;

import java.net.InetAddress;
import java.net.URL;

import org.apache.commons.lang3.StringUtils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * Class description
 *
 *
 * @version        v1.0, 2013-11-17
 * @author         Jim Horner
 */
public class AddressContext {

    /** Field description */
    private String action;

    /** Field description */
    private String messageId;

    /** Field description */
    private String relatesTo;

    /** Field description */
    private String remoteIp;

    /** Field description */
    private String replyTo;

    /** Field description */
    private String to;

    /**
     * Constructs ...
     *
     */
    private AddressContext() {

        super();
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getAction() {
        return action;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getMessageId() {
        return messageId;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getRelatesTo() {
        return relatesTo;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getRemoteIp() {
        return remoteIp;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getReplyTo() {
        return replyTo;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getTo() {
        return to;
    }

    /**
     * Class description
     *
     *
     * @version        v1.0, 2013-11-17
     * @author         Jim Horner
     */
    public static class Builder {

        /** Field description */
        private final AddressContext context;

        /** Field description */
        private final Logger logger = LoggerFactory.getLogger(getClass());

        /**
         *     Constructs ...
         *
         */
        public Builder() {

            super();

            this.context = new AddressContext();
        }

        /**
         * Method description
         *
         *
         * @param action
         *
         * @return
         */
        public Builder action(String action) {

            this.context.action = StringUtils.trimToNull(action);

            return this;
        }

        /**
         * Method description
         *
         *
         * @return
         */
        public AddressContext build() {

            return this.context;
        }

        /**
         * Method description
         *
         *
         * @param messageId
         *
         * @return
         */
        public Builder messageId(String messageId) {

            this.context.messageId = StringUtils.trimToNull(messageId);

            return this;
        }

        /**
         * Method description
         *
         *
         * @param relatesTo
         *
         * @return
         */
        public Builder relatesTo(String relatesTo) {

            this.context.relatesTo = StringUtils.trimToNull(relatesTo);

            return this;
        }

        /**
         * Method description
         *
         *
         * @param remoteIp
         *
         * @return
         */
        public Builder remoteIp(String remoteIp) {

            this.context.remoteIp = StringUtils.trimToNull(remoteIp);

            return this;
        }

        /**
         * Method description
         *
         *
         * @param sender
         *
         * @return
         */
        public Builder replyTo(String sender) {

            this.context.replyTo = StringUtils.trimToNull(sender);

            return this;
        }

        /**
         * Method description
         *
         *
         * @param recipient
         *
         * @return
         */
        public Builder to(String recipient) {

            this.context.to = StringUtils.trimToNull(recipient);

            return this;
        }
    }
}
